﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WarriorRush.GameDynamics.SpecialAbilities
{
    public class Heal : SpecialAbility
    {

        public Heal()
            : base()
        {

            AbilityType = AbilityTypes.Heal;
            Targets = new List<SimplePoint> { new SimplePoint(0, 1), new SimplePoint(0, -1) };
        }

        public override bool Execute(CharacterClass abilityTarget, Arena arena, List<CharacterClass> additonalTargets)
        {

            var targets = arena.GetTargetedSpaces(AbilityOwner.Square, Targets, true);
            foreach (var target in targets)
            {
                target.Character.Stats.Heal(Power);
            }
            return base.Execute(abilityTarget, arena, additonalTargets);
        }

        public override SpecialAbility GetInstance(int power)
        {
            return new Heal() 
            { Power = power, ReplacesAttack = this.ReplacesAttack, ShortName = ShortName, Description = Description };
        }
    }
}
